package com.feishi.core.analytic.element;

import com.feishi.core.analytic.PoType;
import com.feishi.core.analytic.parser.PoParser;

/**
 * Created by caixq on 5/12 012.
 */
public class AnalyticStaticContentTypeDataElement<T> extends AnalyticStaticInputDataElement<T>  implements Comparable<AnalyticStaticContentTypeDataElement<T>>{
    private int level;
    boolean repeatable=false;
    public AnalyticStaticContentTypeDataElement(int length) {
        super(length);
        initType();
    }

    public AnalyticStaticContentTypeDataElement(String name, int length, int level) {
        super(name, length);
        initType();
        this.level=level;
    }

    private void initType() {
        this.type= PoType.ELEMENT_CONTENT_TYPE;
    }

    public AnalyticStaticContentTypeDataElement(String name, int length) {
        super(name, length);
        initType();
    }
    public AnalyticStaticContentTypeDataElement(String name, int length,boolean repeatable) {
        super(name, length);
        initType();
        this.repeatable=repeatable;
    }

    public AnalyticStaticContentTypeDataElement(String name, int length, PoParser<T> parser) {
        super(name, length, parser);
        initType();
    }



    public boolean isRepeatable() {
        return repeatable;
    }

    public void setRepeatable(boolean repeatable) {
        this.repeatable = repeatable;
    }

    @Override
    public int compareTo(AnalyticStaticContentTypeDataElement<T> o) {
        return o.level-level;
    }
}
